@extends('admin.layout.base')
@section('title', '修改权限')
@section('content')
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            修改权限
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="{{ url('/admin/rule') }}">权限管理</a></li>
            <li class="active">修改权限</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- right column -->
            <div class="col-md-12">
                <!-- Horizontal Form -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">修改权限</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" action="{{ url('/admin/rule',['id'=>$rule->id]) }}" method="post">
                        {!! csrf_field() !!}
                        {!! method_field('PUT') !!}
                        <div class="box-body">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">权限标识</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" id="name" name="name" value="{{ $rule->name }}">
                                </div>
                                <div class="col-sm-5">
                                    <p class="form-control-static text-danger">{{ $errors->first('name') }}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="title" class="col-sm-2 control-label">权限说明</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" id="title" name="title" value="{{ $rule->title }}">
                                </div>
                                <div class="col-sm-5">
                                    <p class="form-control-static text-danger">{{ $errors->first('title') }}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label">权限状态</label>
                                <div class="col-sm-5 radio">
                                    <label><input type="radio" name="status" id="" value="1" {{ $rule->status == 1 ? 'checked' : '' }}/>有效</label>
                                    <label><input type="radio" name="status" id="" value="0" {{ $rule->status == 0 ? 'checked' : '' }}/>无效</label>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
                            <button type="submit" class="btn btn-info pull-right">保存</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
                <!-- /.box -->
            </div>
            <!--/.col (right) -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
@endsection
@section('pluginscript')
<!-- FastClick -->
<script src="{{ asset('/dist/admin/plugins/fastclick/fastclick.js') }}"></script>
@endsection